import {lazy} from "react"
import {Navigate } from "react-router-dom"
const My = lazy(()=>import("../pages/my"))
const Home = lazy(()=>import("../pages/home"))
const Shophome = lazy(()=>import("../pages/shophome"))
const Detail = lazy(()=>import("../pages/detail"))
const Myshopcar = lazy(()=>import("../pages/myshopcar"))
const Addaddress = lazy(()=>import("../pages/addaddress"))
const Address = lazy(()=>import("../pages/address"))
const Pull = lazy(()=>import("../pages/pull"))
const routerlist = [
    {
        path:"/home",
        element:<Home></Home>,
        children:[
            {
                path:'/home/shophome',
                element:<Shophome></Shophome>
            },
            {
                path:"/home/my",
                element:<My></My>
            },
            {
                path:"/home/myshopcar",
                element:<Myshopcar></Myshopcar>
            },
            {
                path:"/home/address",
                element:<Address></Address>
            },
            {
                path:"/home",
                element:<Navigate to='/home/shophome'></Navigate>
            }
        ]
    },
    {
        path:"/detail",
        element:<Detail></Detail>
    },
    {
        path:"/addaddress",
        element:<Addaddress></Addaddress>
    },
    {
        path:"/pull",
        element:<Pull></Pull>
    },
    {
        path:"/",
        element:<Navigate to="/home"></Navigate>
    },
]
export default routerlist